<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>学并思云盘</title>
	<link rel="stylesheet" type="text/css" href="<?php echo CSS; ?>/bootstrap.min.css">
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script type="text/javascript" src="<?php echo JS; ?>/bootstrap.min.js"></script>
</head>
<body>
	<nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button class="navbar-toggle collapsed" aria-expanded="false" aria-controls="navbar" type="button" data-toggle="collapse" data-target="#navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">留言板</a>
        </div>
        <div class="navbar-collapse collapse" id="navbar">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
            <li class="dropdown">
              <a class="dropdown-toggle" role="button" aria-expanded="false" aria-haspopup="true" href="#" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
                <li class="divider" role="separator"></li>
                <li class="dropdown-header">Nav header</li>
                <li><a href="#">Separated link</a></li>
                <li><a href="#">One more separated link</a></li>
              </ul>
            </li>
          </ul>
          <div style="float:right;padding-top: 10px;">
          	 <a href="./login.php" class="btn btn-success" >登录</a>
          	<a href="./reg.php" class="btn btn btn-primary" >注册</a>
          </div>
        </div><!--/.nav-collapse -->
      </div>
    </nav>
    <div class="row" style="padding: 80px;padding-bottom: 30px;">
      <!-- 循环数据库数组 -->
		
	</div>
  <style type="text/css">
    .formFile{
      position: relative;
    }
    #inFile{
        position: absolute;
        top: 0px;
        left: 0px;
        width: 80px;
        opacity: 0;
    }
    #addDir{
      float: right;
      position: relative;
      top: -30px;
    }
    .glyphicon-level-up{
      width: 80px;
    }
  </style>
	<div class="row" style="padding: 0px 80px;">
		<form action="./upload1.php" method="post" class="form-inline" enctype="multipart/form-data">
		  <div class="form-group formFile">
        <button  class="btn btn-primary glyphicon glyphicon-level-up" >
		    <input type="file" name="dfsdfsdfsdfdsfsdfsdf[]" multiple="multiple"  id="inFile">
        
		  </div>
		  <button type="submit" class="btn btn-primary glyphicon glyphicon-upload"></button>
		</form>
    <form action="./addDir.php" method="post" class="form-inline" id="addDir" >
      <div class="form-group formFile">
        <input type="text" class="form-control" name="dir" >
      </div>
      <button type="submit" class="btn btn-primary">创建目录</button>
    </form>
	</div>
  <div class="row" style="padding: 50px 80px;">
    <table class="table table-hover">
      <thead>
        <tr>
          <th>缩略图</th>
          <th>文件名</th>
          <th>文件大小</th>
          <th>上传时间</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <?php foreach ($files as  $file): ?>
          <tr>
            
            <td><img src="<?php echo getSmallImg($file) ?>" height='30'></td>
            <?php if (is_dir($file)){ ?>
                <td><a href="./index.php?dir=<?php echo basename($file); ?>"><?php echo basename($file); ?></a></td>
            <?php }else{ ?>
                <td><?php echo basename($file); ?></td>
            <?php } ?>
            <td><?php echo Fsize(filesize($file)); ?></td>
            <td><?php echo Ftime(filectime($file)); ?></td>
            <td>
              <a href="./down.php?file=<?php echo $file; ?>" class="btn btn-warning btn-xs glyphicon glyphicon-download-alt"></a>
              <a href="./del.php?file=<?php echo $file; ?>" class="btn btn-danger btn-xs glyphicon glyphicon-trash"></a>
            </td>
          </tr>
        <?php endforeach ?>
      </tbody>
    </table>
  </div>
</body>
</html>